﻿@model cloudscribe.Core.Web.ViewModels.SiteUser.ChangePasswordViewModel
@inject IStringLocalizer<CloudscribeCore> sr
@inject SiteContext siteContext

@{
    ViewData["Title"] = sr["Change Password"];
    ViewData["BodyClass"] = "manage-section change-password";
}
<h2>@ViewData["Title"]</h2>
<form asp-controller="Manage" asp-action="ChangePassword" method="post" role="form">
    <div asp-validation-summary="All" class="text-danger"></div>
    <div class="form-group">
        <label asp-for="OldPassword">@sr["Old Password"]</label>
        <input asp-for="OldPassword" class="form-control" />
        <span asp-validation-for="OldPassword" class="invalid-feedback"></span>
    </div>
    <div class="form-group">
        <label asp-for="NewPassword">@sr["New Password"]</label>

        <input asp-for="NewPassword" class="form-control" data-val="true" data-val-length=@sr["The new password must be at least {0} characters long.", siteContext.MinRequiredPasswordLength] data-val-length-max="100" data-val-length-min="@siteContext.MinRequiredPasswordLength" data-val-required="New password is required" />

        <span asp-validation-for="NewPassword" class="invalid-feedback"></span>
    </div>
    <div class="form-group">
        <label asp-for="ConfirmPassword">@sr["Confirm New Password"]</label>
        <input asp-for="ConfirmPassword" class="form-control" />
        <span asp-validation-for="ConfirmPassword" class="invalid-feedback"></span>
    </div>
    <div class="form-group">
        <button name="submit" type="submit" class="btn btn-primary">@sr["Change Password"]</button>
    </div>
</form>
@section Scripts {
    <script src="~/cr/js/jquery.validate.min.js"></script>
    <script src="~/cr/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/cr/js/unobtrusive-validation-bs4.min.js"></script>
}
